import React from "react";

class Login extends React.Component {
  constructor(props) {
      super(props);
      this.login = this.login.bind(this);
      this.logout = this.logout.bind(this);
      this.state = {
          isLogin: false
      }
  }

  render() {
      let { isLogin } = this.state;
      return (
          <div>
              {isLogin?<p>****5539
              <button onClick={this.logout}>退出登陆</button></p>:
              <button onClick={this.login}>立即登陆</button>}
          </div>
      )
  }

  logout() {
      this.setState({
          isLogin: false
      })
  }

  login() {
      this.setState({
          isLogin: true
      })
  }
}

export default Login;
